package com.airbat.prize.common.enums;

import com.airbat.prize.common.core.IntArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 标签类型
 */
@Getter
@AllArgsConstructor
public enum TagTypeEnum implements IntArrayValuable {

    //1特征标签 2涉黑恶标签 3团伙标签 4场所标签 5行业标签 6外观标签
    FEATURE(1, "特征标签"),
    FEATURE_AGE(11, "年龄标签"),
    FEATURE_APPEARANCE(12, "外貌标签"),
    FEATURE_SHAPE(13, "外形标签"),
    FEATURE_BEHAVIOR(14, "行为标签"),
    FEATURE_OTHER(19, "其他标签"),
    EVIL(2, "涉黑恶标签"),
    //人员里面的黑恶标签 等于案件警情里的 团伙标签
    GANG(3, "团伙标签"),
    PLACE(4, "场所标签"),
    INDUSTRY(5, "行业标签"),
    SHOW(6, "外观标签"),
    CATEGORY(7, "类别标签"),
    EVNET(8, "事件标签"),
    EVNET_INCENTIVE(81, "事件诱因标签"),
    EVNET_HARM(82, "危害结果标签"),
    EVNET_MEANS(83, "手段标签"),
    EVNET_WAY(84, "方式标签");

    /**
     * 值
     */
    private final Integer value;
    /**
     * 名称
     */
    private final String name;

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TagTypeEnum::getValue).toArray();

    @Override
    public int[] array() {
        return ARRAYS;
    }

    public static String getName(Integer value) {
        return Arrays.stream(values()).filter(tr -> tr.getValue() == value).findFirst().get().getName();
    }
}
